package com.gongpb.langchain4j.demo.manus.tool;

import com.fasterxml.jackson.datatype.jsr310.ser.OffsetDateTimeSerializer;
import dev.langchain4j.agent.tool.ToolExecutionRequest;
import dev.langchain4j.agent.tool.ToolSpecification;
import dev.langchain4j.model.chat.request.json.JsonObjectSchema;

public class FileSaveTool implements Tool {
    private String filePath;
    private String content;


    @Override
    public ToolSpecification getSpecification() {
        try {
            return ToolSpecification.builder()
                    .name("file_save")
                    .description("save file to local")
                    .parameters(JsonObjectSchema.builder()
                            .addStringProperty("content", "file content")
                            .addStringProperty("filePath", "file path")
                            .required("content","filePath")
                            .build())
                    .build();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public ToolResult runTool() throws ClassNotFoundException {
        return null;
    }
}
